import Cookies from 'js-cookie';
import {getUid} from './tools';

const cookie = Cookies.withAttributes({
	domain: document.domain
});

let UDID = localStorage.getItem("st_uuid");

if (!UDID) {
    UDID = getUid();
    localStorage.setItem("st_uuid", UDID);
}

const cookiesObj = {
	'Client-Channel': 'huawei',
	'Client-Id': '101',
	'Client-Version': '1.2.1',
	'Accept-Language': 'zh-cn',
	// Authorization: "",
	'Team-Name': null,
	'Client-Type': 'web',
	'Device-Name': 'iPhone+13+mini',
	'Device-Resolution': '1090*1080',
	'Device-UDID': UDID,
	'System-Name': 'Android',
	'System-Version': '15.4.1'
};

Object.keys(cookiesObj).map((key) => {
	cookie.set(key, cookiesObj[key]);
});

export default cookie;
